package org.gis.mapserver.suppliers.adapters;

import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import org.gis.mapserver.adapter.SourceAdapter;
import org.gis.mapserver.source.Source;
import org.gis.mapserver.source.SourceType;


/**
 *
 * @author gus
 */
public class RasterImageSourceAdapter extends SourceAdapter
{
    public RasterImageSourceAdapter( Source source ) throws Exception
    {
        super(source);
    }
    
    @Override
    protected boolean isSupported(SourceType type )
    {
        return  SourceType.PngImage == type;
    }

    public BufferedImage getImage() throws Exception
    {
        return ImageIO.read(source.getStream());
    }
}
